<template>
	<view style="background-color: #fff;">
		<view style="display: flex;justify-content: space-around;height: 230upx;">
			<view style="margin-top: 30upx;">
				<image style="width: 170upx;height: 170upx;" src="../../../../static/hb2.png" mode=""></image>
			</view>
			<view style="height: 200upx;">
				<view style="margin-top: 10upx;">
					<text>红包余额</text>
					<view>{{yue}}</view>
				</view>
			</view>
		</view>
		<view class="container">
			<!-- 带上拉加载的数据列表 -->
			<view class="big-loading-text loading-text" style="height: 80upx;line-height: 80upx;">
				<text style="min-width: 330upx;">时间</text>
				<text>数量</text>
				<text>明细</text>
			</view>
			<!-- 数据列表 -->
			<scroll-view scroll-y="true" style="height: 800upx;">
				<view class="loading-text" @click="toarticlexq(value.projectid)" v-for="(value,key) in jfz_out" :key="key" style="height: 50upx;line-height: 50upx;">
					<text style="display: block;min-width: 330upx;">{{value.createtime}}</text>
					<text>{{value.num}}</text>
					<text>{{value.remark}}</text>
				</view>
			</scroll-view>
		</view>
		<view>
			<button @click="totx" type="default" style="background-color: #05052B;color: #fff;position: fixed;bottom: 0;width: 100%;">立即提现</button>
		</view>
	</view>
</template>

<script> 
	import uniLoadMore from '../../../../components/uni-load-more.vue';
	export default {
		components: {
			uniLoadMore
		},
		data() {
			return {
				openid:'',
				out_log:[],
				jfz:'',
				jfz_out:'',
				credit2:[],
				yue:'',
			}
		},
		onLoad: function(e) {
			uni.showLoading()
			uni.getStorage({
				key: 'openid',
				success: (res) => {
					this.openid = res.data
					this.getdata()
					this.getdata2()
					//页面一加载时请求一次数据`
					uni.hideLoading()
				},
				fail: () => {
					uni.navigateTo({
						url: '../login/login'
					});
				}
			});
		},
		methods: {
			getdata(){
				uni.request({
					url: 'http://mall.zhongzhengyicai.com/app/index.php?i=2&c=entry&m=ewei_shopv2&do=mobile&r=member.credit2&app=1',
					method: 'POST',
					data: {'openid':this.openid},
					header:{'Content-Type':'application/x-www-form-urlencoded'},
					success:(res) => {
						console.log(res)
						this.credit2 = res.data.credit2
						this.yue = res.data.yue
					},
					fail: () => {},
					complete: () => {}
				});
			},
			getdata2(){
				uni.request({
					url: 'http://mall.zhongzhengyicai.com/app/index.php?i=2&c=entry&m=ewei_shopv2&do=mobile&r=tzz.credit2_index&app=1',
					method: 'POST',
					data: {'openid':this.openid},
					header:{'Content-Type':'application/x-www-form-urlencoded'},
					success:(res) => {
						console.log(res)
						this.jfz_out = res.data.out_log
						this.jfz = res.data.out_log
					},
					fail: () => {},
					complete: () => {}
				});
			},
			totx(){
				uni.navigateTo({
					 url:'../tx/tx'
				})
			}
		},
		
	}
</script>

<style>
.container {
	/* background-color: #FEA23D; */
}
.loading-text {
	margin: ;
	background-color: fff;
	display: flex;
}

.loading-text text:nth-child(1) {
	padding-left: 15upx;
	border-bottom: 2upx solid rgb(243,243,243);
	background-color: #fff;
	flex: 1;
	text-align: center;
	font-size: 26upx;
}
.loading-text text:nth-child(2) {
	border-bottom: 2upx solid rgb(243,243,243);
	background-color: #fff;
	flex: 1;
	text-align: center;
	font-size: 26upx;
}
.loading-text text:nth-child(3) {
	border-bottom: 2upx solid rgb(243,243,243);
	background-color: #fff;
	flex: 1.5;
	text-align: center;
	font-size: 26upx;
}
.loading-text text:nth-child(4) {
	border-bottom: 2upx solid rgb(243,243,243);
	background-color: #fff;
	flex: 5;
	text-align: center;
	font-size: 26upx;
}
.all_add {
	height: 80upx;
	text-align: center;
	line-height: 80upx;
	background-color: rgb(254,162,61);
	color: #fff;
}
.big-loading-text {
	font-weight: 550;
	border-bottom: 2upx solid rgb(243,243,243);
}
uni-page-body{height:100%;}
</style>

